package com.drojian.demo1.root_fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.drojian.demo.R;
import com.drojian.demo1.test2.ProgressBarActivity;
import com.drojian.demo1.test2.SeekBarActivity;


public class RootFragment2 extends Fragment {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.ui1_fragment_root2, container, false);
        Button progressBar = view.findViewById(R.id.progressBar1);
        Button seekBar = view.findViewById(R.id.seekBar1);

        progressBar.setOnClickListener(v -> startActivity(new Intent(getContext(), ProgressBarActivity.class)));
        seekBar.setOnClickListener(v -> startActivity(new Intent(getContext(), SeekBarActivity.class)));


        return view;
    }

    public static RootFragment2 newInstance() {
        return new RootFragment2();
    }
}